Skip to content

Add indexer and str to API documentation #5124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 15, 2013

Conversation

jankatins
Copy link
Contributor

closes #5068

@@ -72,7 +72,12 @@ def upload_prev(ver, doc_root='./'):
if os.system(pdf_cmd):
raise SystemExit('Upload PDF to %s from %s failed' % (ver, doc_root))


def build_pandas():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is covered by make doc already.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on windows :-) And it doesn't seem to be in the makefile (at least make doc has no compile step)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this make it trigger on any attempt to build?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I know. I simple tried to get the doc build working (cd doc; python make.py html -> error) and had to C&P from the build_prev function to the commandline and was fed up after the second time :-) Now its cd doc; python make.py build_pandas; python make.py html

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as long as this doesn't cause doc builds to wipe and rebuild pandas, it's fine with me.

@jtratner
Copy link
Contributor

jtratner commented Oct 6, 2013

Seems like a reasonable (and time-efficient) way to at least document the API.

@jtratner
Copy link
Contributor

jtratner commented Oct 6, 2013

really minor note, can you fix the typo in your commit message: convinience --> convenience? Not a big deal, just would be nice.

@jankatins
Copy link
Contributor Author

done

@jtratner
Copy link
Contributor

jtratner commented Oct 6, 2013

@@ -419,8 +425,46 @@ Time series-related
Series.tz_convert
Series.tz_localize

String handling
~~~~~~~~~~~~~~~~~~~
``Series.str`` can be used to access the values of the series as strings and apply several methods to it. Due to implementation details the methods show up here as methods of the ``StringMethods`` class.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we stick to the 79 chars line length? (or at least to 99 chars) Because now it is difficult to read in the source code (for example on github, it doesn't fit on my screen).
Is there a convention in pandas to follow or not follow pep8 on this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you're adding something new to the docs, generally should keep to 79 characters

@jorisvandenbossche
Copy link
Member

@JanSchulz It is always good to add more docs to the api docs! (there are still missing a lot).

Regarding building the (api) docs on windows, I have the same problem with the io.rst. I always remove that part in io.rst when developing/building the docs locally .. (which is a little bit annoying).

@jreback
Copy link
Contributor

jreback commented Oct 7, 2013

@JanSchulz while you are adding....can you put in to_timedelta ? (next to to_datetime)

@jankatins
Copy link
Contributor Author

@jreback
Copy link
Contributor

jreback commented Oct 7, 2013

you seem to be double counting the undocumented, e.g. read_csv shows up in your list, but is documented

@jankatins
Copy link
Contributor Author

@jreback That's because the API documentation refers to the context pandas.io.parsers, so the imported pandas.read_csv is marked as undocumented.

@jankatins
Copy link
Contributor Author

@jreback: to_timedelta added

@jorisvandenbossche, @jtratner: shortend the lines

Sorry for the rebase mess :-( Not sure how to convince github that the PR now starts at a different commit :-(

@jtratner
Copy link
Contributor

jtratner commented Oct 7, 2013

force push the branch.

Also, just a heads up, some of the methods you point out are quasi-internal (like is_) or experimental-ish. Maybe you could put them all in the wiki and we can collectively work to document them, then combine into one big PR?

@jankatins
Copy link
Contributor Author

@jreback re double counting: I removed more or less all context from api.rst (which resulted in only two errors: one for Stata*: #5144 and one for sql read_frame/ write_frame). The resulting count: public methods: 983; documented: 503, undocumented: 522

@jtratner done: https://github.com/pydata/pandas/wiki/Undocumented-public-functions

I also updated the ipynb to the version I used to generate this data (you also must change api.rst so that all context point directly to pandas and not to modules like pandas.io.sql)

@jtratner
Copy link
Contributor

jtratner commented Oct 7, 2013

can you do that for the rest of the pandas docs?

@jorisvandenbossche
Copy link
Member

See also #4790. If eg DataFrame is included in the docs, the docstring of all methods will automatically be linked to (at least from the DataFrame docstring).

@jreback
Copy link
Contributor

jreback commented Oct 11, 2013

@JanSchulz pls rebase on master

@jreback
Copy link
Contributor

jreback commented Oct 13, 2013

@JanSchulz can you rebase and squash?

@jankatins
Copy link
Contributor Author

@jreback done (hopefully...)

@jorisvandenbossche
Copy link
Member

@JanSchulz Did you rebase? Because it seems that your commit on api.rst has not included the changes of eg #5208 (although I don't think it would conflict)

@jreback
Copy link
Contributor

jreback commented Oct 14, 2013

can you add the indexeras (iat/iloc/loc...etc) to Panel as well?

@jankatins
Copy link
Contributor Author

Not sure why it didn't pick up the new changes, but this seems to include them.

@jankatins
Copy link
Contributor Author

@jtratner What do you want for the rest of the documentation? As I understood the docs, the rest does not have links to the API documentation (see e.g. http://pandas.pydata.org/pandas-docs/dev/groupby.html)

@jreback
Copy link
Contributor

jreback commented Oct 14, 2013

@JanSchulz this looks fine....

should we include __getitem__? (get you wouldn't really search on that though...?)

and not sure we actually have explicitydocs on it

@jreback
Copy link
Contributor

jreback commented Oct 15, 2013

@JanSchulz this looks fine

@jorisvandenbossche @jtratner merge?

@jorisvandenbossche
Copy link
Member

@jreback certainly fine!
But I think it has to be rebased again .. (because of my last PR that got merged yesterday, which also touched api.rst, I don't know how smart git is when it are not the same lines that changed).

@jankatins
Copy link
Contributor Author

@jreback @jorisvandenbossche rebased and removed some trailing whitespace

@jreback
Copy link
Contributor

jreback commented Oct 15, 2013

@jorisvandenbossche pls give a once over..looks mergeable to me

@jorisvandenbossche
Copy link
Member

@jreback good to merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API reference for Series.str, DataFrame.{iloc|loc}?
4 participants